package priv.mill.controller;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import priv.mill.dao.model.MillUser;
import priv.mill.dao.model.UserT;

@Controller
@RequestMapping("view")
public class MyViewController {

	private static final Logger logger = Logger
			.getLogger(MyViewController.class);
	
	@RequestMapping("testView")
	public String testView(){
		return "helloView";//自定义视图名的驼峰命名
	}
	
	/**
	 * 测试重定向，本例将重定向到项目根地址的mill下面，而该地址已经是在spring-mvc配置文件中设置了直接视图的
	 * @return
	 */
		
	@RequestMapping("/testRedirect")
	public String testRedirect(){
		System.out.println("testRedirect");
		return "redirect:/mill";
	}
	@RequestMapping("/testForward")
	public String testForward(){
		System.out.println("testForward");
		return "forward:/mill";
	}
	
	@RequestMapping("testConvert")
	public String testConvert(@RequestParam("user") UserT user){
		logger.debug(user);
		return "yuansheng/session";
	}
	
	@RequestMapping("testDateFormat")
	public String testDateFormat(MillUser user) {
		logger.debug(user);
		
		return "yuansheng/session";
	}
}
